package cn.geminis.warehouse.service.delivery.entity.repository;

import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.time.LocalDate;

public interface DeliveryRepository {

    @Modifying
    @Transactional(rollbackOn = Exception.class)
    @Query("update Delivery d set d.loadTime = ?1, d.state = 20  where d.id in ?2")
    int load(LocalDate loadTime, String[] ids);

    @Modifying
    @Transactional(rollbackOn = Exception.class)
    @Query("update Delivery d set d.transitTime = ?1, d.state = 30  where d.id in ?2")
    int transit(LocalDate transitTime, String[] ids);

}
